package cn.kgc.xinwen.controller;

import cn.kgc.xinwen.pojo.Category;
import cn.kgc.xinwen.pojo.ResultEntity;
import cn.kgc.xinwen.service.CategoryService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author shkstart
 * @create 2020-05-29 8:58
 */
@RestController
public class CategoryController {

    @Resource
    CategoryService categoryService;

    @RequestMapping("/selectAll")
    public ResultEntity<List<Category>> selectAll(){
        List<Category> categories = categoryService.selectAll();
        return ResultEntity.successWithoutData(categories);
    }
}

